<?php
$table=mysql_real_escape_string($table);
$cols=implode(',',array_map('mysql_real_escape_string',$cols));
$limit=isset($limit)?mysql_real_escape_string($limit):'';
$q=$db->prepare("select $cols from $table");
$q->execute();
$rows=array();
if($q->num_rows()){ while($row=$q->fetch(PDO::FETCH_ASSOC))$rows[]=$row; } //add column keys
else{ if($empty)echo$empty; }



/*
unset($cols);
unset($table);
unset($limit);
unset($q);
*/
?>